# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=libblockdev
pkgver=2.20
pkgrel=1
pkgdesc="A library for manipulating block devices"
arch=('x86_64')
url="https://github.com/rhinstaller/libblockdev"
license=('LGPL')
depends=('btrfs-progs' 'dosfstools' 'dmraid' 'gptfdisk' 'libbytesize' 'lvm2' 'mdadm' 'ndctl'
         'parted' 'volume_key' 'xfsprogs' 'kmod' 'libyaml')
makedepends=('gobject-introspection' 'systemd' 'python')
source=("$pkgname-$pkgver.tar.gz::https://github.com/rhinstaller/libblockdev/archive/$pkgver-1.tar.gz")
sha512sums=('4cb6b18d5de63461f35e0b6f6896599aa41da2c995839c2e88661dacdf07522842b612820fb1d83edbde72092cc62295d5411e8607f52c611db7f02aa16c9ab3')

prepare() {
  # sed -i 's/-ldmraid //' $pkgname-$pkgver-1/src/lib/Makefile.am
  :
}

build() {
  cd "$srcdir"/$pkgname-$pkgver-1
  ./autogen.sh
  ./configure --prefix=/usr --sysconfdir=/etc --without-lvm_dbus
  make
}

check() {
  cd "$srcdir"/$pkgname-$pkgver-1
  make check
}

package() {
  cd "$srcdir"/$pkgname-$pkgver-1
  make DESTDIR="$pkgdir" install
}
